package ModelLayer;
import java.util.ArrayList;

/**
 * Write a description of class ListCustomers here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class CustomerContainer
{
    private ArrayList<Customer> customers;

    /**
     * Constructor for objects of class ListCustomers
     */
    public CustomerContainer()
    {
        customers = new ArrayList<>();
    }
    
    public void addCustomer(Customer customer)
    {
        customers.add(customer);
    }
    
    /*public void removeCustomer(long _id)
    {
        for(Customer customer:customers)
        {
            if (customer.getId() == _id)
            {
                customers.remove(customer);
            }
        }
    }*/
    
    public void removeCustomer(long _id)
    {
        for(int i=0; i<customers.size(); i++)
        {
            if(customers.get(i).getId() == _id)
            {
                customers.remove(i);
            }
        }
    }
    
    public ArrayList<Customer> getCustomers()
    {
        return customers;
    }
}
